package com.CusterRelSys.control;

import com.CusterRelSys.entity.CstActivity;
import com.CusterRelSys.service.ActivityesMapperServiceZyh;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

@Controller
@RequestMapping("/CstActivity")
public class CstActivityControlZyh {
    @Autowired
    private ActivityesMapperServiceZyh activityesMapperServiceZyh;

    /**
     * 查询客户信息
     * @param atvCustNo
     * @return
     */
    @RequestMapping("/queryActivityByNo")
    @ResponseBody
    public List<CstActivity> queryActivityByNo(String atvCustNo){
        return activityesMapperServiceZyh.queryActivityByNo(atvCustNo);
    }

    @RequestMapping("/queryActivityById")
    @ResponseBody
    public CstActivity queryActivityById(Integer atvId){
        return activityesMapperServiceZyh.queryActivityById(atvId);
    }

    /**
     * 添加
     * @param cstActivity
     * @return
     */
    @RequestMapping("/addActivites")
    @ResponseBody
    public int addActivites(CstActivity cstActivity){
        return activityesMapperServiceZyh.addActivites(cstActivity);
    }

    /**
     * 修改
     * @param cstActivity
     * @return
     */
    @RequestMapping("/updateActivites")
    @ResponseBody
    public int updateActivites(CstActivity cstActivity){
        System.out.println(activityesMapperServiceZyh.updateActivites(cstActivity)+"=========");
        return activityesMapperServiceZyh.updateActivites(cstActivity);
    }

    /**
     * 删除
     * @param atvId
     * @return
     */
    @RequestMapping("/delActivites")
    @ResponseBody
    public int delActivites(Integer atvId){
        return activityesMapperServiceZyh.delActivites(atvId);
    }
}
